package view;

import java.awt.Dimension;
import java.awt.event.ActionEvent;

import javax.swing.JButton;

import javax.swing.WindowConstants;
import org.jdesktop.application.Application;

import javax.swing.AbstractAction;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class PanelAltaProv extends javax.swing.JPanel {


	private static PanelAltaProv instancia;
	private JLabel jLabelAltaProv;
	private JButton jButtonCancelar;
	private JButton jButtonGuardar;
	private JTextField jTextFieldNomProv;
	private JLabel jLabelNomProv;
	private AbstractAction actionCancelar;

	public static PanelAltaProv getInstancia(){
		if(instancia==null){
			instancia=new PanelAltaProv();
		}
		return instancia;
	}
	
	private PanelAltaProv() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			this.setSize(400, 219);
			this.setLayout(null);
			this.add(getJLabelAltaProv());
			this.add(getJLabelNomProv());
			this.add(getJTextFieldNomProv());
			this.add(getJButtonGuardar());
			this.add(getJButtonCancelar());
			Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(this);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private JLabel getJLabelAltaProv() {
		if(jLabelAltaProv == null) {
			jLabelAltaProv = new JLabel();
			jLabelAltaProv.setBounds(137, 12, 132, 14);
			jLabelAltaProv.setName("jLabelAltaProv");
		}
		return jLabelAltaProv;
	}
	
	private JLabel getJLabelNomProv() {
		if(jLabelNomProv == null) {
			jLabelNomProv = new JLabel();
			jLabelNomProv.setBounds(67, 58, 70, 14);
			jLabelNomProv.setName("jLabelNomProv");
		}
		return jLabelNomProv;
	}
	
	private JTextField getJTextFieldNomProv() {
		if(jTextFieldNomProv == null) {
			jTextFieldNomProv = new JTextField();
			jTextFieldNomProv.setBounds(136, 55, 96, 21);
		}
		return jTextFieldNomProv;
	}
	
	private JButton getJButtonGuardar() {
		if(jButtonGuardar == null) {
			jButtonGuardar = new JButton();
			jButtonGuardar.setBounds(81, 153, 82, 21);
			jButtonGuardar.setName("jButtonGuardar");
		}
		return jButtonGuardar;
	}
	
	private JButton getJButtonCancelar() {
		if(jButtonCancelar == null) {
			jButtonCancelar = new JButton();
			jButtonCancelar.setBounds(190, 153, 87, 21);
			jButtonCancelar.setName("jButtonCancelar");
			jButtonCancelar.setAction(getActionCancelar());
		}
		return jButtonCancelar;
	}

	private AbstractAction getActionCancelar() {
		if(actionCancelar == null) {
			actionCancelar = new AbstractAction("Cancelar", null) {
				public void actionPerformed(ActionEvent evt) {
					instancia.setVisible(false);
				}
			};
		}
		return actionCancelar;
	}
}
